package com.zl.hyzg.controller;

import com.zl.hyzg.domain.Car;
import com.zl.hyzg.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/car")
public class CarController {
    @Autowired
    private CarService carService;
    @PostMapping("/add")
    public String addCar(@RequestBody Car car){
        int result = carService.addCar(car);
        if(result==1){
            return "success";
        }else{
            return "fail";
        }
    }
}
